﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Qting.AOI.Serialize
{
    [Serializable]
    [Table(name: "aoi_pcbs")]
    public class AoiPcbs
    {
        [Description("主键")]
        [Key]
        [Column(name: "id", TypeName = "varchar")]
        [StringLength(255)]
        public string id { get; set; }

        [Column(name: "software_id", TypeName = "varchar")]
		[Description("程式id")]
        [StringLength(50)]
        public string software_id { get; set; }

        [Column(name: "pcb_number")]
        [StringLength(250)]
        [Description("板号")]
        public string pcb_number { get; set; }

        [Column(name: "pcb_name")]
        [StringLength(250)]
        [Description("PCB名称")]
        public string pcb_name { get; set; }

        [Column(name: "carrier_width")]
        [Description("载板长")]
        public int carrier_width { get; set; }

        [Column(name: "carrier_height")]
        [Description("载板宽")]
        public int carrier_height { get; set; }

        [Column(name: "pcb_width")]
        [Description("PCB长")]
        public int pcb_width { get; set; }

        [Column(name: "pcb_height")]
        [Description("PCB宽")]
        public int pcb_height { get; set; }

        [Column(name: "pcb_childen_number")]
        [Description("PCB子基板数")]
        public int pcb_childen_number { get; set; }

        [Column(name: "pcb_part_number")]
        [Description("PCB元件数")]
        public int pcb_part_number { get; set; }

        [Column(name: "pcb_part_number_advm")]
        [Description("PCB-ADVM元件数")]
        public int pcb_part_number_advm { get; set; }

        [Column(name: "pcb_path")]
        [StringLength(250)]
        [Description("对应的FTP保存的地址")]
        public string pcb_path { get; set; }

        [Column(name: "ng_count_2d")]
        [Description("ng计数2d")]
        public int ng_count_2d { get; set; }

        [Column(name: "ng_count_ai")]
        [Description("ng计数ai")]
        public int ng_count_ai { get; set; }

        [Column(name: "ng_count_advm")]
        [Description("ng计数advm")]
        public int ng_count_advm { get; set; }

        [DefaultValue(0)]
        [Column(name: "is_misjudge_2d")]
        [Description("判断结果 , 0表示NG, 1表示OK")]
        public int is_misjudge_2d { get; set; }

        [DefaultValue(0)]
        [Column(name: "is_misjudge_ai")]
        [Description("是否误判, 0否 1是, 只要results下有一个误判，那该值就改为1")]
        public int is_misjudge_ai { get; set; }

        [DefaultValue(0)]
        [Column(name: "is_misjudge_advm")]
        [Description("是否误判, 0否 1是, 只要results_advm下有一个误判，那该值就改为1")]
        public int is_misjudge_advm { get; set; }

        [DefaultValue(0)]
        [Column(name: "is_error")]
        [Description("是否报错, 0否 1是")]
        public int is_error { get; set; }

        [Column(name: "create_time")]
        [Description("创建时间")]
        public DateTime create_time { get; set; }

        [NotMapped]
        public List<AoiResults> results { get; set; }

        [NotMapped]
        public List<Aoi2DResults> results_2d { get; set; }

        [NotMapped]
        public List<AoiAdvmResults> results_advm { get; set; }

        [NotMapped]
        public List<AoiNgTypes> m_ngTypeIdList { get; set; }

        [NotMapped]
        public List<string> m_ngTypeList_2d { get; set; }

        [NotMapped]
        [Description("检测的面数")]
        public int SurfaceNumber { get; set; }

        [NotMapped]
        [Description("是否3D设备")]
        public int Is3DMachine { get; set; }

        [NotMapped]
        [Description("是否AI设备")]
        public int IsAIMachine { get; set; }

        [NotMapped]
        [Description("是否Advm设备")]
        public int IsAdvmMachine { get; set; }

        [NotMapped]
        [Description("拼板条码")]
        public List<tagBarcodeInfo> m_barcodeList { get; set; }

        [NotMapped]
        [Description("检测结束时间")]
        public DateTime end_time { get; set; }

        [NotMapped]
        [Description("拼板信息")]
        public List<AoiSubBoards> m_subBoards { get; set; }

        [NotMapped]
        [Description("是否双轨设备")]
        public bool IsDualMachine { get; set; }

        [NotMapped]
        [Description("是否轨道2")]
        public bool IsLane2 { get; set; }

        [NotMapped]
        [Description("叉板信息")]
        public List<tagBadBoard> m_badBoardList { get; set; }

        [NotMapped]
        [Description("坐标缩放倍率")]
        public float Scale { get; set; }

        [NotMapped]
        [Description("机器线别")]
        [StringLength(250)]
        public string MachineLine { get; set; }

        [NotMapped]
        [Description("机器站点")]
        [StringLength(250)]
        public string MachineStation { get; set; }

        [NotMapped]
        [Description("自定义参数")]
        public string CustomerPars { get; set; }

        [NotMapped]
        [Description("AOI的主机IP")]
        public string AOIServiceIp { get; set; }
    }
}
